package com.hmall.gateway.filters;

import org.springframework.cloud.gateway.filter.GatewayFilter;
import org.springframework.cloud.gateway.filter.GatewayFilterChain;
import org.springframework.cloud.gateway.filter.factory.AbstractGatewayFilterFactory;
import org.springframework.stereotype.Component;
import org.springframework.web.server.ServerWebExchange;
import reactor.core.publisher.Mono;

/**
 * @author: lxr
 * @Date: 2025/09/05 17:42
 * @Description:
 */
@Component
public class CustomerSuccessGatewayFilterFactory extends AbstractGatewayFilterFactory<Object> {
   /*
   应用过滤方法
    */
    @Override
    public GatewayFilter apply(Object config) {

        return new GatewayFilter() {
            /*
            拦截方法
             */
            @Override
            public Mono<Void> filter(ServerWebExchange exchange, GatewayFilterChain chain) {
                System.out.println("CustomerSuccessGatewayFilterFactory apply");
                return chain.filter(exchange);
            }
        };
    }
}
